<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>residu</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>residu</b> -  residue</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[V]=residu(P,Q1,Q2)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>P, Q1, Q2</b>
        </tt>: polynomials or matrix polynomials with real or complex coefficients.</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>V=residu(P,Q1,Q2)</b>
      </tt> returns the matrix <tt>
        <b>V</b>
      </tt>
    such that <tt>
        <b>V(i,j)</b>
      </tt> is the sum of the residues of the
    rational fraction <tt>
        <b>P(i,j)/(Q1(i,j)*Q2(i,j))</b>
      </tt> calculated
    at the zeros of <tt>
        <b>Q1(i,j)</b>
      </tt>.</p>
    <p>
      <tt>
        <b>Q1(i,j)</b>
      </tt> and <tt>
        <b>Q2(i,j)</b>
      </tt> must not have any common root.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

s=poly(0,'s');
H=[s/(s+1)^2,1/(s+2)];N=numer(H);D=denom(H);
w=residu(N.*horner(N,-s),D,horner(D,-s));  //N(s) N(-s) / D(s) D(-s)
sqrt(sum(w))  //This is H2 norm
h2norm(tf2ss(H))
//
p=(s-1)*(s+1)*(s+2)*(s+10);a=(s-5)*(s-1)*(s*s)*((s+1/2)**2);
b=(s-3)*(s+2/5)*(s+3);
residu(p,a,b)+531863/4410    //Exact
z=poly(0,'z');a=z^3+0.7*z^2+0.5*z-0.3;b=z^3+0.3*z^2+0.2*z+0.1;
atild=gtild(a,'d');btild=gtild(b,'d');
residu(b*btild,z*a,atild)-2.9488038   //Exact
a=a+0*%i;b=b+0*%i;
real(residu(b*btild,z*a,atild)-2.9488038) //Complex case
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../control/pfss.htm">
        <tt>
          <b>pfss</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../linear/bdiag.htm">
        <tt>
          <b>bdiag</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="roots.htm">
        <tt>
          <b>roots</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../programming/poly.htm">
        <tt>
          <b>poly</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../robust/gtild.htm">
        <tt>
          <b>gtild</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p> F.Delebecque INRIA</p>
  </body>
</html>
